import { request } from 'umi';

import type { IHTTPRESPONSE } from '@/types/Common';

/**
 * @param params 获取产品信息
 */
export async function getProductMess(params: any) {
  return request<IHTTPRESPONSE<Product[]>>('/api/SaasProduct/Query', {
    method: 'POST',
    data: params,
  });
}

export interface saasProductPricingStrategy {
  id: string;
  price: number;
  billingCycle: number;
  billingCycleUnit: string;
  billingWorkLineNumber: number;
  billingPersonNumber: number;
  discountPencent: number;
  category: number;
}

export interface Product {
  id: string;
  name: string;
  description: string;
  price: number;
  category: number;
  pricingStrategyId: string;
  enabled: boolean;
  saasProductPricingStrategy: saasProductPricingStrategy;
}
